using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rotempco.Core.Logging.Objects;
using Rotempco.Core.Logging.Objects.Stores;
using Rotempco.Core.Logging.EntityObjects.Objects;

namespace Rotempco.Core.Logging.Managers
{
    internal class LogManager
    {
        internal void SaveLog(LogStack logEntry)
        {
            if (LogSettingsStore.Instance.LogSettings == null)
                return;

            if (LogSettingsStore.Instance.LogSettings.EnableEmail)
                LogManagerFactory.Instance.LogToEmailManager.SendLogMessage(logEntry);

            if (LogSettingsStore.Instance.LogSettings.EnableDatabase)
                LogManagerFactory.Instance.LogToDatabaseManager.SaveLogMessage(logEntry);
        }
    }
}
